package hbnu;
import java.util.Scanner;
public class test2 {
    public static void main(String[] args) {
        int num;
        Scanner sc =new Scanner(System.in);
        num=sc.nextInt();
        int []arr=new int [6];
        for(int i=5;i>=0;i--)
        {
            int temp=num%10;
            int temp2=(temp+5)%10;
            arr[i]=temp2;
            num/=10;
        }
        for(int i=5;i>=0;i--)
        {
            System.out.println(arr[i]);
        }

    }
}
